# REQUIRES: amdgpu-registered-target
# RUN: llvm-reduce -abort-on-invalid-reduction -simplify-mir --delta-passes=register-masks -mtriple=amdgcn-amd-amdhsa --test FileCheck --test-arg --check-prefix=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
# RUN: FileCheck --match-full-lines --check-prefix=RESULT %s < %t

# CHECK-INTERESTINGNESS: CustomRegMask
# CHECK-INTERESTINGNESS-SAME: $vcc_lo,
# CHECK-INTERESTINGNESS-SAME: $agpr8,
# CHECK-INTERESTINGNESS-SAME: $sgpr99,
# CHECK-INTERESTINGNESS-SAME: $vgpr23,
# CHECK-INTERESTINGNESS-SAME: $vgpr48_vgpr49_vgpr50,

# CHECK-INTERESTINGNESS: CustomRegMask
# CHECK-INTERESTINGNESS-SAME: $sgpr35,$sgpr39,$sgpr40,$sgpr60_sgpr61,$sgpr62_sgpr63,$sgpr64_sgpr65,$sgpr80_sgpr81


# RESULT: $sgpr30_sgpr31 = SI_CALL %0, 0, CustomRegMask($vcc_lo,$agpr8,$sgpr99,$vgpr23,$vgpr48_vgpr49_vgpr50,$vgpr49_vgpr50_vgpr51)
# RESULT: $sgpr30_sgpr31 = SI_CALL %0, 0, CustomRegMask($sgpr35,$sgpr39,$sgpr40,$sgpr60_sgpr61,$sgpr62_sgpr63,$sgpr64_sgpr65,$sgpr80_sgpr81)

---
name: func
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $vgpr0, $vgpr1, $sgpr8_sgpr9
    %0:sreg_64_xexec = COPY $sgpr8_sgpr9

    $sgpr30_sgpr31 = SI_CALL %0:sreg_64_xexec, 0, CustomRegMask($vgpr8_vgpr9, $vgpr9_vgpr10_vgpr11,$vcc_lo,$agpr8,$sgpr99,$vgpr23,$vgpr48_vgpr49_vgpr50,$vgpr49_vgpr50_vgpr51, $vgpr52_vgpr53_vgpr54,$vcc_hi,$sgpr0_sgpr1_sgpr2_sgpr3,$sgpr4_sgpr5_sgpr6_sgpr7)
     $sgpr30_sgpr31 = SI_CALL %0:sreg_64_xexec, 0, CustomRegMask($sgpr35,$sgpr39,$sgpr40,$sgpr60_sgpr61,$sgpr62_sgpr63,$sgpr64_sgpr65,$sgpr80_sgpr81)

    S_ENDPGM 0
...
